#include "flVector2.h"

flVector2::flVector2(float _x, float _y)
{
	x = _x;
	y = _y;
}
void flVector2::set(float _x, float _y)
{
	x = _x;
	y = _y;
}
		
/*
	Overloading operators
*/
bool flVector2::operator==(const flVector2& v)
{
	return (x == v.x) && (y == v.y);
}
bool flVector2::operator!=(const flVector2& v)
{
	return (x != v.x) || (y != v.y);
}

// Functions with other Vector2
void		flVector2::operator=	(const flVector2& v)
{
	x = v.x;
	y = v.y;
}
flVector2	flVector2::operator+	(const flVector2& v) const
{
	return flVector2(x + v.x, y + v.y);
}
flVector2&	flVector2::operator+=	(const flVector2& v)
{
	x += v.x;
	y += v.y;
	return *this;
}
flVector2	flVector2::operator-	(const flVector2& v) const
{
	return flVector2(x - v.x, y - v.y);
}
flVector2&	flVector2::operator-=	(const flVector2& v)
{
	x -= v.x;
	y -= v.y;
	return *this;
}
flVector2	flVector2::operator*	(const flVector2& v) const
{
	return flVector2(x * v.x, y * v.y);
}
flVector2&	flVector2::operator*=	(const flVector2& v)
{
	x *= v.x;
	y *= v.y;
	return *this;
}
flVector2	flVector2::operator/	(const flVector2& v) const
{
	return flVector2(x / v.x, y / v.y);
}
flVector2&	flVector2::operator/=	(const flVector2& v)
{
	x /= v.x;
	y /= v.y;
	return *this;
}

// Functions with float
void		flVector2::operator=	(const float f)
{
	x = f;
	y = f;
}
flVector2	flVector2::operator+	(const float f) const
{
	return flVector2(x + f, y + f);
}
flVector2&	flVector2::operator+=	(const float f)
{
	x += f;
	y += f;
	return *this;
}
flVector2	flVector2::operator-	(const float f) const
{
	return flVector2(x - f, y - f);
}
flVector2&	flVector2::operator-=	(const float f)
{
	x -= f;
	y -= f;
	return *this;
}
flVector2	flVector2::operator*	(const float f) const
{
	return flVector2(x * f, y * f);
}
flVector2&	flVector2::operator*=	(const float f)
{
	x *= f;
	y *= f;
	return *this;
}
flVector2	flVector2::operator/	(const float f) const
{
	return flVector2(x / f, y / f);
}
flVector2&	flVector2::operator/=	(const float f)
{
	x /= f;
	y /= f;
	return *this;
}